home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 November: Tool Chest / Dev.CD Nov 94.toast / Tool Chest / !Interfaces / Universal Interfaces 2.0a1 / PInterfaces / Video.p < prev    next >
Encoding:
Text File  |  1994-07-17  |  12.6 KB  |  318 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        Video.p
  3.  
  4.      Copyright:    © 1984-1994 by Apple Computer, Inc.
  5.                  All rights reserved.
  6.  
  7.      Version:    Universal Interfaces 2.0a1.  ETO #15, MPW prerelease.  Sunday, July 17, 1994. 
  8.  
  9.      Bugs?:        If you find a problem with this file, send the file and version
  10.                  information (from above) and the problem description to:
  11.  
  12.                      Internet:    apple.bugs@applelink.apple.com
  13.                      AppleLink:    APPLE.BUGS
  14.  
  15. }
  16.  
  17. {$IFC UNDEFINED UsingIncludes}
  18. {$SETC UsingIncludes := 0}
  19. {$ENDC}
  20.  
  21. {$IFC NOT UsingIncludes}
  22.  UNIT Video;
  23.  INTERFACE
  24. {$ENDC}
  25.  
  26. {$IFC UNDEFINED __VIDEO__}
  27. {$SETC __VIDEO__ := 1}
  28.  
  29. {$I+}
  30. {$SETC VideoIncludes := UsingIncludes}
  31. {$SETC UsingIncludes := 1}
  32.  
  33.  
  34. {$IFC UNDEFINED __QUICKDRAW__}
  35. {$I Quickdraw.p}
  36. {$ENDC}
  37. {    Types.p                                                        }
  38. {        ConditionalMacros.p                                        }
  39. {    MixedMode.p                                                    }
  40. {    QuickdrawText.p                                                }
  41.  
  42. {$PUSH}
  43. {$ALIGN MAC68K}
  44. {$LibExport+}
  45.  
  46. CONST
  47.     mBaseOffset                    = 1;                            {Id of mBaseOffset.}
  48.     mRowBytes                    = 2;                            {Video sResource parameter Id's }
  49.     mBounds                        = 3;                            {Video sResource parameter Id's }
  50.     mVersion                    = 4;                            {Video sResource parameter Id's }
  51.     mHRes                        = 5;                            {Video sResource parameter Id's }
  52.     mVRes                        = 6;                            {Video sResource parameter Id's }
  53.     mPixelType                    = 7;                            {Video sResource parameter Id's }
  54.     mPixelSize                    = 8;                            {Video sResource parameter Id's }
  55.     mCmpCount                    = 9;                            {Video sResource parameter Id's }
  56.     mCmpSize                    = 10;                            {Video sResource parameter Id's }
  57.     mPlaneBytes                    = 11;                            {Video sResource parameter Id's }
  58.     mVertRefRate                = 14;                            {Video sResource parameter Id's }
  59.     mVidParams                    = 1;                            {Video parameter block id.}
  60.     mTable                        = 2;                            {Offset to the table.}
  61.     mPageCnt                    = 3;                            {Number of pages}
  62.     mDevType                    = 4;                            {Device Type}
  63.     oneBitMode                    = 128;                            {Id of OneBitMode Parameter list.}
  64.     twoBitMode                    = 129;                            {Id of TwoBitMode Parameter list.}
  65.     fourBitMode                    = 130;                            {Id of FourBitMode Parameter list.}
  66.     eightBitMode                = 131;                            {Id of EightBitMode Parameter list.}
  67.  
  68.     sixteenBitMode                = 132;                            {Id of SixteenBitMode Parameter list.}
  69.     thirtyTwoBitMode            = 133;                            {Id of ThirtyTwoBitMode Parameter list.}
  70.     firstVidMode                = 128;                            {The new, better way to do the above. }
  71.     secondVidMode                = 129;                            { QuickDraw only supports six video }
  72.     thirdVidMode                = 130;                            { at this time.      }
  73.     fourthVidMode                = 131;
  74.     fifthVidMode                = 132;
  75.     sixthVidMode                = 133;
  76.     spGammaDir                    = 64;
  77.     spVidNamesDir                = 65;
  78.  
  79. { csTimingFormat values in VDTimingInfo }
  80. { look in the declaration rom for timing info }
  81.     kDeclROMtables                = 'decl';
  82.  
  83. { csConnectFlags values in VDDisplayConnectInfo }
  84.     kAllModesValid                = 0;                            { All modes not trimmed by primary init are good close enough to try }
  85.     kAllModesSafe                = 1;                            { All modes not trimmed by primary init are know to be safe }
  86.     kReportsTagging                = 2;                            { Can detect tagged displays (to identify smart monitors) }
  87.     kHasDirectConnect            = 3;                            { True implies that driver can talk directly to device (e.g. serial data link via sense lines) }
  88.     kIsMonoDev                    = 4;                            { Says whether there’s an RGB (0) or Monochrome (1) connection. }
  89.     kUncertainConnection        = 5;                            { There may not be a display (no sense lines?). }
  90.  
  91. { csDisplayType values in VDDisplayConnectInfo }
  92.     kUnknownConnect                = 1;                            { Not sure how we’ll use this, but seems like a good idea. }
  93.     kPanelConnect                = 2;                            { For use with fixed-in-place LCD panels. }
  94.     kPanelTFTConnect            = 2;                            { Alias for kPanelConnect }
  95.     kFixedModeCRTConnect        = 3;                            {  For use with fixed-mode (i.e., very limited range) displays. }
  96.     kMultiModeCRT1Connect        = 4;                            { 320x200 maybe, 12" maybe, 13" (default), 16" certain, 19" maybe, 21" maybe }
  97.     kMultiModeCRT2Connect        = 5;                            { 320x200 maybe, 12" maybe, 13" certain, 16" (default), 19" certain, 21" maybe }
  98.     kMultiModeCRT3Connect        = 6;                            { 320x200 maybe, 12" maybe, 13" certain, 16" certain, 19" default, 21" certain }
  99.     kMultiModeCRT4Connect        = 7;                            { Expansion to large multi mode (not yet used) }
  100.     kModelessConnect            = 8;                            { Expansion to modeless model (not yet used) }
  101.     kFullPageConnect            = 9;                            { 640x818 (to get 8bpp in 512K case) and 640x870 (these two only) }
  102.     kVGAConnect                    = 10;                            { 640x480 VGA default -- question everything else }
  103.     kNTSCConnect                = 11;                            { NTSC ST (default), FF, STconv, FFconv }
  104.     kPALConnect                    = 12;                            { PAL ST (default), FF, STconv, FFconv }
  105.     kHRConnect                    = 13;                            { 640x400 (to get 8bpp in 256K case) and 640x480 (these two only) }
  106.     kPanelFSTNConnect            = 14;                            { For use with fixed-in-place LCD FSTN (aka “Supertwist”) panels }
  107.  
  108. { csTimingFlags values in VDTimingInfoRec }
  109.     kModeValid                    = 0;                            { Says that this mode should NOT be trimmed. }
  110.     kModeSafe                    = 1;                            { This mode does not need confirmation }
  111.     kModeDefault                = 2;                            { This is the default mode for this type of connection }
  112.     kModeShowNow                = 3;                            { This mode should always be shown (even though it may require a confirm) }
  113.     kModeNotResize                = 4;                            { This mode should not be used to resize the display (eg. mode selects a different connector on card) }
  114.  
  115. { Control Codes }
  116.     cscReset                    = 0;
  117.     cscKillIO                    = 1;
  118.     cscSetMode                    = 2;
  119.     cscSetEntries                = 3;
  120.     cscSetGamma                    = 4;
  121.     cscGrayPage                    = 5;
  122.     cscGrayScreen                = 5;
  123.     cscSetGray                    = 6;
  124.     cscSetInterrupt                = 7;
  125.     cscDirectSetEntries            = 8;
  126.     cscSetDefaultMode            = 9;
  127.     cscSwitchMode                = 10;
  128.     cscSetSync                    = 11;
  129.     cscSetVideoConfiguration    = 22;
  130.  
  131. { Status Codes }
  132.     cscGetMode                    = 2;
  133.     cscGetEntries                = 3;
  134.     cscGetPageCnt                = 4;
  135.     cscGetPages                    = 4;                            { This is what C&D 2 calls it. }
  136.     cscGetPageBase                = 5;
  137.     cscGetBaseAddr                = 5;                            { This is what C&D 2 calls it. }
  138.     cscGetGray                    = 6;
  139.     cscGetInterrupt                = 7;
  140.     cscGetGamma                    = 8;
  141.     cscGetDefaultMode            = 9;
  142.     cscGetCurMode                = 10;
  143.     cscGetSync                    = 11;
  144.     cscGetConnection            = 12;                            { Return information about the connection to the display }
  145.     cscGetModeTiming            = 13;                            { Return timing info for a mode }
  146.     cscGetModeBaseAddress        = 14;                            { Return base address information about a particular mode }
  147.     cscGetScanProc                = 15;                            { QuickTime scan chasing routine }
  148.     cscGetNextResolution        = 20;
  149.     cscGetVideoParameters        = 21;
  150.     cscGetGammaList                = 22;
  151.  
  152.  
  153. TYPE
  154.     VPBlock = RECORD
  155.         vpBaseOffset:            LONGINT;                                {Offset to page zero of video RAM (From minorBaseOS).}
  156.         vpRowBytes:                INTEGER;                                {Width of each row of video memory.}
  157.         vpBounds:                Rect;                                    {BoundsRect for the video display (gives dimensions).}
  158.         vpVersion:                INTEGER;                                {PixelMap version number.}
  159.         vpPackType:                INTEGER;
  160.         vpPackSize:                LONGINT;
  161.         vpHRes:                    LONGINT;                                {Horizontal resolution of the device (pixels per inch).}
  162.         vpVRes:                    LONGINT;                                {Vertical resolution of the device (pixels per inch).}
  163.         vpPixelType:            INTEGER;                                {Defines the pixel type.}
  164.         vpPixelSize:            INTEGER;                                {Number of bits in pixel.}
  165.         vpCmpCount:                INTEGER;                                {Number of components in pixel.}
  166.         vpCmpSize:                INTEGER;                                {Number of bits per component}
  167.         vpPlaneBytes:            LONGINT;                                {Offset from one plane to the next.}
  168.     END;
  169.     VPBlockPtr = ^VPBlock;
  170.  
  171.     VDEntryRecord = RECORD
  172.         csTable:                Ptr;                                    {(long) pointer to color table entry=value, r,g,b:INTEGER}
  173.     END;
  174.     VDEntRecPtr = ^VDEntryRecord;
  175.  
  176. { Parm block for SetGray control call }
  177.     VDGrayRecord = RECORD
  178.         csMode:                    BOOLEAN;                                {Same as GDDevType value (0=mono, 1=color)}
  179.     END;
  180.     VDGrayPtr = ^VDGrayRecord;
  181.  
  182. { Parm block for SetEntries control call }
  183.     VDSetEntryRecord = RECORD
  184.         csTable:                ^ColorSpec;                                {Pointer to an array of color specs}
  185.         csStart:                INTEGER;                                {Which spec in array to start with, or -1}
  186.         csCount:                INTEGER;                                {Number of color spec entries to set}
  187.     END;
  188.     VDSetEntryPtr = ^VDSetEntryRecord;
  189.  
  190. { Parm block for SetGamma control call }
  191.     VDGammaRecord = RECORD
  192.         csGTable:                Ptr;                                    {pointer to gamma table}
  193.     END;
  194.     VDGamRecPtr = ^VDGammaRecord;
  195.  
  196.     VDSwitchInfoRec = RECORD
  197.         csMode:                    INTEGER;                                {(word) mode depth}
  198.         csData:                    LONGINT;                                {(long) functional sResource of mode}
  199.         csPage:                    INTEGER;                                {(word) page to switch in}
  200.         csBaseAddr:                Ptr;                                    {(long) base address of page (return value)}
  201.         csReserved:                LONGINT;                                {(long) Reserved (set to 0) }
  202.     END;
  203.     VDSwitchInfoPtr = ^VDSwitchInfoRec;
  204.  
  205.     VDTimingInfoRec = RECORD
  206.         csTimingMode:            LONGINT;                                { LONGINT - (long) timing mode (a la InitGDevice) }
  207.         csTimingReserved:        LONGINT;                                { LONGINT - (long) reserved }
  208.         csTimingFormat:            LONGINT;                                { LONGINT - (long) what format is the timing info }
  209.         csTimingData:            LONGINT;                                { LONGINT - (long) data supplied by driver }
  210.         csTimingFlags:            LONGINT;                                { LONGINT - (long) mode within device }
  211.     END;
  212.     VDTimingInfoPtr = ^VDTimingInfoRec;
  213.  
  214.     VDDisplayConnectInfoRec = RECORD
  215.         csDisplayType:            INTEGER;                                { INTEGER - (word) Type of display connected }
  216.         csConnectTagged:        INTEGER;                                { INTEGER - (word) Display is currently "it" (tagged to identify component) }
  217.         csConnectFlags:            LONGINT;                                { LONGINT - (long) tell us about the connection }
  218.         csDisplayComponent:        LONGINT;                                { LONGINT - (long) if the card has a direct connection to the display, it returns the display component here (FUTURE) }
  219.         csConnectReserved:        LONGINT;                                { LONGINT - (long) reserved }
  220.     END;
  221.     VDDisplayConnectInfoPtr = ^VDDisplayConnectInfoRec;
  222.  
  223.     VDPageInfo = RECORD
  224.         csMode:                    INTEGER;                                {(word) mode within device}
  225.         csData:                    LONGINT;                                {(long) data supplied by driver}
  226.         csPage:                    INTEGER;                                {(word) page to switch in}
  227.         csBaseAddr:                Ptr;                                    {(long) base address of page}
  228.     END;
  229.     VDPgInfoPtr = ^VDPageInfo;
  230.  
  231.     VDSizeInfo = RECORD
  232.         csHSize:                INTEGER;                                {(word) desired/returned h size}
  233.         csHPos:                    INTEGER;                                {(word) desired/returned h position}
  234.         csVSize:                INTEGER;                                {(word) desired/returned v size}
  235.         csVPos:                    INTEGER;                                {(word) desired/returned v position}
  236.     END;
  237.     VDSzInfoPtr = ^VDSizeInfo;
  238.  
  239.     VDSettings = RECORD
  240.         csParamCnt:                INTEGER;                                {(word) number of params}
  241.         csBrightMax:            INTEGER;                                {(word) max brightness}
  242.         csBrightDef:            INTEGER;                                {(word) default brightness}
  243.         csBrightVal:            INTEGER;                                {(word) current brightness}
  244.         csCntrstMax:            INTEGER;                                {(word) max contrast}
  245.         csCntrstDef:            INTEGER;                                {(word) default contrast}
  246.         csCntrstVal:            INTEGER;                                {(word) current contrast}
  247.         csTintMax:                INTEGER;                                {(word) max tint}
  248.         csTintDef:                INTEGER;                                {(word) default tint}
  249.         csTintVal:                INTEGER;                                {(word) current tint}
  250.         csHueMax:                INTEGER;                                {(word) max hue}
  251.         csHueDef:                INTEGER;                                {(word) default hue}
  252.         csHueVal:                INTEGER;                                {(word) current hue}
  253.         csHorizDef:                INTEGER;                                {(word) default horizontal}
  254.         csHorizVal:                INTEGER;                                {(word) current horizontal}
  255.         csHorizMax:                INTEGER;                                {(word) max horizontal}
  256.         csVertDef:                INTEGER;                                {(word) default vertical}
  257.         csVertVal:                INTEGER;                                {(word) current vertical}
  258.         csVertMax:                INTEGER;                                {(word) max vertical}
  259.     END;
  260.     VDSettingsPtr = ^VDSettings;
  261.  
  262.     DisplayModeID = LONGINT;
  263.  
  264.     VideoDeviceType = LONGINT;
  265.  
  266.     VideoMode = LONGINT;
  267.  
  268.     GammaTableID = LONGINT;
  269.  
  270.  
  271. CONST
  272.     kFirstDepthMode                = 128;
  273.     kSecondDepthMode            = 129;
  274.     kThirdDepthMode                = 130;
  275.     kFourthDepthMode            = 131;
  276.     kFifthDepthMode                = 132;
  277.     kSixthDepthMode                = 133;
  278.  
  279.  
  280. TYPE
  281.     VDResolutionInfoRec = RECORD
  282.         csPreviousDisplayModeID: DisplayModeID;                            { ID of the previous resolution in a chain }
  283.         csDisplayModeID:        DisplayModeID;                            { ID of the next resolution }
  284.         csHorizontalPixels:        LONGINT;                                { # of pixels in a horizontal line }
  285.         csVerticalLines:        LONGINT;                                { # of lines in a screen }
  286.         csRefreshRate:            Fixed;                                    { Vertical Refresh Rate in Hz }
  287.         csMaxDepthMode:            VideoMode;                                { 0x80-based number representing max bit depth }
  288.     END;
  289.     VDResolutionInfoPtr = ^VDResolutionInfoRec;
  290.  
  291.     VDVideoParametersInfoRec = RECORD
  292.         csDisplayModeID:        DisplayModeID;                            { the ID of the resolution we want info on }
  293.         csDepthMode:            VideoMode;                                { The bit depth we want the info on (0x80 based) }
  294.         csVPBlockPtr:            VPBlockPtr;                                { Pointer to a vdeo parameter block }
  295.         csPageCount:            LONGINT;                                { Number of pages supported by the resolution }
  296.         csDeviceType:            VideoDeviceType;                        { Device Type:  Direct, Fixed or CLUT; }
  297.     END;
  298.     VDVideoParametersInfoPtr = ^VDVideoParametersInfoRec;
  299.  
  300.     VDGammaInfoRec = RECORD
  301.         csLastGammaID:            GammaTableID;                            { the ID of the previous gamma table }
  302.         csNextGammaID:            GammaTableID;                            { the ID of the next gamma table }
  303.         csGammaPtr:                Ptr;                                    { Ptr to a DeclROM style gamma table }
  304.     END;
  305.     VDGammaInfoPtr = ^VDGammaInfoRec;
  306.  
  307.  
  308. {$ALIGN RESET}
  309. {$POP}
  310.  
  311. {$SETC UsingIncludes := VideoIncludes}
  312.  
  313. {$ENDC} {__VIDEO__}
  314.  
  315. {$IFC NOT UsingIncludes}
  316.  END.
  317. {$ENDC}
  318.